﻿namespace CommonData.Data.Core
{
    using CommonData.Entity;
    using CommonData.Model.Core;
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Runtime.InteropServices;

    public interface IDbFactory : IDisposable
    {
        string CreateConverageSql(Type type, Converage converage);
        string CreateConverageSql(Type type, Converage converage, string propertyName);
        string CreateConverageSql(Type type, Converage converage, string propertyName, IDictionary<string, object> dic, out IDataParameter[] param, ConditionComponent component);
        string CreateDeleteSql(IEntity entity, out IDataParameter[] param);
        string CreateDeleteSql(IEntity entity, out IDataParameter[] param, string propertyName);
        string CreateDeleteSql(IEntity entity, out IDataParameter[] param, string[] propertyNames);
        string CreateDeleteSql(IEntity entity, out IDataParameter[] param, ConditionComponent component);
        string CreateDeleteSql(Type type, object value, out IDataParameter[] param);
        string CreateDeleteSql(Type type, object value, out IDataParameter[] param, string[] propertyNames);
        string CreateDeleteSql(Type type, object value, out IDataParameter[] param, string propertyName);
        string CreateInsertSql<T>(T t, out IDataParameter[] param) where T: IEntity;
        string CreateInsertSql(IEntity entity, out IDataParameter[] param);
        string CreateInsertSql(Type type, object value, out IDataParameter[] param);
        IDataParameter CreateParameter(string name);
        IDataParameter CreateParameter(string name, DataType type);
        IDataParameter CreateParameter(string name, object value);
        IDataParameter CreateParameter(string name, DataType type, int size);
        IDataParameter CreateParameter(string name, DataType type, object value);
        IDataParameter CreateParameter(string name, DataType type, int size, object value);
        string CreateQueryByPropertySql(Type type, IDictionary<string, object> dic, out IDataParameter[] param);
        string CreateQueryByPropertySql(Type type, IDictionary<string, object> dic, out IDataParameter[] param, ConditionComponent component);
        string CreateQueryByPropertySql(Type type, string propertyName, object value, out IDataParameter[] param);
        string CreateQuerySql(Type type);
        string CreateSingleSql(Type entityType);
        string CreateSingleSql(IEntity entity, out IDataParameter[] param);
        string CreateSingleSql(IEntity entity, out IDataParameter[] param, string[] propertyNames);
        string CreateSingleSql(Type type, object pkPropertyValue, out IDataParameter[] param);
        string CreateSingleSql(Type type, object value, out IDataParameter[] param, string[] propertyNames);
        string CreateUpdateSql(IEntity entity, out IDataParameter[] param);
        string CreateUpdateSql(IEntity entity, out IDataParameter[] param, ConditionComponent component);
        string CreateUpdateSql(IEntity entity, out IDataParameter[] param, string propertyName);
        string CreateUpdateSql(IEntity entity, out IDataParameter[] param, string[] propertyNames);
        string CreateUpdateSql(Type type, object value, out IDataParameter[] param);
        string CreateUpdateSql(Type type, object value, out IDataParameter[] param, string[] propertyNames);
        string CreateUpdateSql(Type type, object value, out IDataParameter[] param, string propertyName);
    }
}

